package com.zxxy.spring12.service.impl.impl;

import dao.IAccountDao;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public class AssountServiceImpl implements IAccountService{
    private IAccountDao accountDao;
    public IAccountDao getAccountDao(){
        return accountDao;
    }
    public void setAccountDao(IAccountDao accountDao) {
        this.accountDao = accountDao;

    }
    @Override
    @Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
    public void transer(String outer,String inner,int money){
        accountDao.out(outer,money);
 //       int i = 1 / 0;
        accountDao.in(inner,money);
    }


}
